import asyncio
from baseHandler import Application
from channel.channel_huiju import SettleHandler, AlipayHandler, NotiHandler, SettNotiHandler, AliNotiHandler, \
    AliPay

if __name__ == "__main__":

    application = Application([
        (r"/huiju/(\w+)", AlipayHandler),
        (r"/huijusettle/(\w+)", SettleHandler),
        (r"/noti/huiju", NotiHandler),
        (r"/noti/huiju_sett", SettNotiHandler),
        (r"/noti/huiju_qr", AliNotiHandler)
    ], debug=True)

    alipay = AliPay("https://www.joinpay.com", "", "")
    application.alipay = alipay
    port = '10027'
    loop = asyncio.get_event_loop()
    application.listen(port, address='127.0.0.1')
    # logger.info("huiju channel staring")
    application.init_with_loop(loop)
    loop.run_forever()
